package com.weiaibenpao.demo.chislim.presenter;

import com.weiaibenpao.demo.chislim.base.BasePresenter;
import com.weiaibenpao.demo.chislim.bean.MeBean;
import com.weiaibenpao.demo.chislim.retrofit.RetrofitUtils;
import com.weiaibenpao.demo.chislim.retrofit.rx.NetWorkTransformer;
import com.weiaibenpao.demo.chislim.retrofit.rx.SimpleObserver;
import com.weiaibenpao.demo.chislim.view.MeFragementView;

/**
 * Created by lenovo on 2017/12/26.
 */

public class MeFragmentPresenter extends BasePresenter<MeFragementView> {
    public void getMeFargmentBean(int userId) {
        RetrofitUtils.getAPIService().meFragment(userId).
                compose(new NetWorkTransformer<MeBean>()).
//                compose(new LoadingTransformer<MeBean>(mContext)).
                subscribe(new SimpleObserver<MeBean>(mCompositeDisposable) {
                    @Override
                    public void call(MeBean meBean) {
                        getView().getDataSuccess(meBean);

                    }


                });
    }
}
